package com.app.backendmain.controller;

import com.app.response.BaseResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: ZhengJunJie
 * @Date: 2020/5/25 18:01
 */
@RestController
@RequestMapping(path = "/test")
public class TestController {

    @GetMapping("/success")
    public BaseResponse testResponseCodeSuccess() {
        return BaseResponse.success("成功");
    }

    @GetMapping("/fail")
    public BaseResponse testResponseCodeFail() {
        return BaseResponse.fail();
    }

    @GetMapping("/exception")
    public BaseResponse testResponseCodeException() {
        throw new RuntimeException("测试异常！");
    }
}
